package com.jichaoyun.sys.controller;

import com.jichaoyun.common.ex.MyException;
import com.jichaoyun.common.model.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyExceptionHandler {

  /**
   * 处理自定义异常
   *
   */
  @ExceptionHandler(value = MyException.class)
  @ResponseBody
  public Result bizExceptionHandler(MyException e) {

    return Result.resultError(e);
  }


}
